<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>事件解绑</title>
</head>
<body>
    <button id="btn">抽奖</button>
    <script>
        // btn.onclick = function(){
        //     console.log('谢谢惠顾')
        //     // this.disabled = 'disabled'
        //     this.onclick = null
        // }
        btn.addEventListener('click',handler)
        function handler(){
            console.log('谢谢惠顾')
            this.removeEventListener('click', handler)
        }
    </script>
</body>
</html>